by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

Apache removed the Authorization Header, and there is no solution in $_SERVER.

You can try to add the following content in .htaccess, and it will be normal.
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
In this way, you can use pure PHP to get the token in the header of the request.
<?php
echo $_SERVER['HTTP_AUTHORIZATION'];

 

Tags: php

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


php

Randomly generate four yards of English

Randomly generate four yards of English

fastapi,phpenv,docker

How do I create a fastapi runtime environment with phpenv

phpenv php laravel runs HAProxy, and automatically applies for and updates free certification, now let him run Python's fastapi. There is no limit to phpenv, the limit is your idea.😆

docker,phpenv

Unable to ping host.docker.internal on Linux

You can check with docker version, confirm that the version is Docker v20.10+, you can add extra_hosts as follows: